﻿Imports System.Xml.Serialization

<XmlRoot("Settings")> _
Public Class ApplicationSettings

    Private Const DEFAULT_WIDTH As Integer = 430
    Private Const DEFAULT_HEIGHT As Integer = 300

    Public Sub New()
        Me.PsxfinExePath = "psxfin.exe"
        Me.AspectRatio = 1
        Me.WindowSize = "640x480"
        Me.CpuPriority = 3
        Me.HideLogWindow = False
        Me.FormMainViewMode = System.Windows.Forms.View.List
        Me.FormMainSize = New System.Drawing.Size(DEFAULT_WIDTH, DEFAULT_HEIGHT)
        Dim left As Integer = CInt((My.Computer.Screen.WorkingArea.Width / 2) - (DEFAULT_WIDTH / 2))
        Dim top As Integer = CInt((My.Computer.Screen.WorkingArea.Height / 2) - (DEFAULT_HEIGHT / 2))
        Me.FormMainLocation = New System.Drawing.Point(left, top)
    End Sub

#Region " Properties "

    Private m_psxfinexepath As String
    Private m_aspectration As Integer
    Private m_windowsize As String
    Private m_cpupriority As Integer
    Private m_hidelogwindow As Boolean
    Private m_formmainviewmode As New System.Windows.Forms.View
    Private m_formmainlocation As System.Drawing.Point
    Private m_formmainsize As System.Drawing.Size

    Public Property PsxfinExePath() As String
        Get
            Return m_psxfinexepath
        End Get
        Set(ByVal value As String)
            m_psxfinexepath = value
        End Set
    End Property

    Public Property AspectRatio() As Integer
        Get
            Return m_aspectration
        End Get
        Set(ByVal value As Integer)
            m_aspectration = value
        End Set
    End Property

    Public Property WindowSize() As String
        Get
            Return m_windowsize
        End Get
        Set(ByVal value As String)
            m_windowsize = value
        End Set
    End Property

    Public Property CpuPriority() As Integer
        Get
            Return m_cpupriority
        End Get
        Set(ByVal value As Integer)
            m_cpupriority = value
        End Set
    End Property

    Public Property HideLogWindow() As Boolean
        Get
            Return m_hidelogwindow
        End Get
        Set(ByVal value As Boolean)
            m_hidelogwindow = value
        End Set
    End Property

    Public Property FormMainViewMode() As System.Windows.Forms.View
        Get
            Return m_formmainviewmode
        End Get
        Set(ByVal value As System.Windows.Forms.View)
            m_formmainviewmode = value
        End Set
    End Property

    Public Property FormMainLocation() As System.Drawing.Point
        Get
            Return m_formmainlocation
        End Get
        Set(ByVal value As System.Drawing.Point)
            m_formmainlocation = value
        End Set
    End Property

    Public Property FormMainSize() As System.Drawing.Size
        Get
            Return m_formmainsize
        End Get
        Set(ByVal value As System.Drawing.Size)
            m_formmainsize = value
        End Set
    End Property

#End Region

End Class
